home *** CD-ROM | disk | FTP | other *** search
- Path: god.bel.alcatel.be!btmpj7!ian
- From: ian@rsd.bel.alcatel.be (Ian Ward)
- Newsgroups: comp.lang.c
- Subject: Re: Tough FACTORIAL math problem...
- Date: 16 Feb 1996 16:17:47 GMT
- Organization: Alcatel Bell Telephone
- Distribution: world
- Message-ID: <4g2anb$gre@btmpjg.god.bel.alcatel.be>
- References: <4g285r$gre@btmpjg.god.bel.alcatel.be>
- Reply-To: ian@rsd.bel.alcatel.be
- NNTP-Posting-Host: btmpj7.rsd.bel.alcatel.be
-
-
- Or you could try...
-
- int last_digit2 (num)
- int num;
- {static int fred [] =
- {1,1,2,6,4,2,2,4,2,8,8,8,
- 6,8,2,6,6,2,6,4,4,4,8,4,
- 6,8,8,6,8,2,2,2,4,2,8,4,
- 4,8,4,6,6,6,2,6,4,2,2,4,2,8};
- return fred[num>9?10+((num-10)%40):num];}
-
-
- ---
- Ian Ward's opinions only : ian@rsd.bel.alcatel.be
-
-